package com.system.model;

import java.util.Date;

import com.jfinal.plugin.activerecord.Model;


/**
 * @author LRC
 * @createDate 2015年5月25日
 * @description 操作日志模块
 */
public class ActionLog extends Model<ActionLog> {
	/**
	 * 版本ID 1L
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 实例化公共数据操作层对象
	 */
	public static final ActionLog dao = new ActionLog();
	
	/**
	 * @updateTeim 2015年5月27日下午8:59:23
	 * @description 提交新增日志
	 * @return
	 */
	public static boolean addActionLog(Object userCode,String model,String action,
			String targetTable,String targetData,String log,boolean result){
		ActionLog actionLog = new ActionLog();
		actionLog.set("userCode", userCode);
		actionLog.set("model", model);
		actionLog.set("action", action);
		actionLog.set("targetTable", targetTable);
		actionLog.set("targetData",targetData);
		actionLog.set("actionTime", new Date());
		actionLog.set("actionResult", result);
		return actionLog.save();
	}
}
